home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Tele / S / SmartClone.3.cpt / SmartClone 0.3.rsrc / STR#_1010.txt < prev    next >
Encoding:
Text File  |  1988-08-22  |  4.2 KB  |  221 lines

  1. SERVICE:               COMMAND KEY: ?
  2.  
  3. IF Service <> "" THEN ‚àÇ
  4.  
  5.     DBoxSay = "You cannot change modem files while logged on to " & Service & "." & ‚àÇ
  6.  
  7.         "Are you sure you want to log off?": ‚àÇ
  8.  
  9.     DBox 2: ‚àÇ
  10.  
  11.     IF DBoxResult% = CANCEL% THEN DOMONITOR:END ‚àÇ
  12.  
  13.     ELSE DOLOGOFF: ‚àÇ
  14.  
  15.         IF ResultCode% <> 0 THEN ‚àÇ  ' check for errors executing "DO FILE"
  16.  
  17.             badFile = Service: ‚àÇ
  18.  
  19.             badLabel = "LogOff": ‚àÇ
  20.  
  21.             GOSUB doFileError: ‚àÇ
  22.  
  23.             END
  24.  
  25.  
  26.  
  27.     IF ResultCode% <> 0 THEN ‚àÇ  ' check for errors executing "DO FILE"
  28.  
  29.         badFile = Service: ‚àÇ
  30.  
  31.         badLabel = "LogOff": ‚àÇ
  32.  
  33.         GOSUB doFileError: ‚àÇ
  34.  
  35.         END
  36.  
  37.  
  38.  
  39. getModemFile: 'gets name of modem file and stores it in variable @modemFile
  40.  
  41.     HOLD ON
  42.  
  43.     Message = ""
  44.  
  45.     prompt1 = "Please select the modem file:"
  46.  
  47.     fileType1 = "SERV"
  48.  
  49.     HOLD OFF
  50.  
  51.     modemFile = GetFile(prompt1,fileType1,ServiceFPath)
  52.  
  53.     IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END
  54.  
  55.     HOLD ON
  56.  
  57.     CURSOR WATCH
  58.  
  59.  
  60.  
  61.     'parse the path from string returned by GetFile
  62.  
  63.     myPath = modemFile
  64.  
  65.     lastColon% = 0
  66.  
  67. getLastColon:
  68.  
  69. '{RTV - 5/19/88 A faster colon parser}
  70.  
  71.     IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ‚àÇ
  72.  
  73.         lastColon% = InStr%(lastColon%+1, myPath, ":"): GOTO getLastColon
  74.  
  75.  
  76.  
  77.     myPath = Left(myPath,lastColon%)
  78.  
  79.     modemFile = Mid(modemFile, lastColon%+1)
  80.  
  81.  
  82.  
  83.     ServiceFPath = myPath   ' set ServiceFPath to path returned by GetFile
  84.  
  85.     Message = ""
  86.  
  87.     HOLD OFF
  88.  
  89.     DO FILE modemFile "Identify"
  90.  
  91.     IF (ResultCode% <> 0) THEN ‚àÇ
  92.  
  93.         IF (ResultCode% <> 106) THEN ‚àÇ          ' bad label error
  94.  
  95.             badFile = modemFile: ‚àÇ              ' 106 is "label not found" error
  96.  
  97.             badLabel = "Identify": ‚àÇ
  98.  
  99.             GOSUB doFileError: ‚àÇ
  100.  
  101.             CURSOR RESET: ‚àÇ
  102.  
  103.             END ‚àÇ
  104.  
  105.         ELSE Message = "NotModem"               ' coerce dbox for error #106
  106.  
  107.  
  108.  
  109.     ' check for if modemFile is really a modem file
  110.  
  111.     IF UpCase(Message) <> "MODEM" THEN ‚àÇ
  112.  
  113.         DBoxSay = modemFile & " does not appear to be a modem file.  " & ‚àÇ
  114.  
  115.             "An example of a modem file for Apple and " & ‚àÇ
  116.  
  117.             "Hayes-compatible modems is ""Hayes Modem.""  Try again?": ‚àÇ
  118.  
  119.         DBOX 2: ‚àÇ
  120.  
  121.         IF DBoxResult% = OK% THEN GOTO getModemFile ‚àÇ
  122.  
  123.         ELSE CURSOR RESET: END
  124.  
  125.     HOLD ON
  126.  
  127.  
  128.  
  129.     ' check to see if modem file in Lookup Table is still there
  130.  
  131.     IF @ModemFile <> "" THEN ‚àÇ
  132.  
  133.         IF NOT Exists%(ServiceFPath & @modemFile) THEN CLEAR @modemFile ‚àÇ
  134.  
  135.         ELSE DO FILE @modemFile "ClearTable": ‚àÇ
  136.  
  137.             IF ResultCode% <> 0 THEN ‚àÇ  ' check for errors executing "DO FILE"
  138.  
  139.                 badFile = @modemFile: ‚àÇ
  140.  
  141.                 badLabel =  "ClearTable": ‚àÇ
  142.  
  143.                 GOSUB doFileError: ‚àÇ
  144.  
  145.                 END
  146.  
  147.  
  148.  
  149.     @modemFile = modemFile  ' put new modem file in lookup table
  150.  
  151.     HOLD OFF
  152.  
  153.     CURSOR RESET
  154.  
  155.     Message = ""            ' routine was successful
  156.  
  157.     END
  158.  
  159.  
  160.  
  161. doFileError:    ' puts up error dialog and aborts
  162.  
  163.     HOLD OFF
  164.  
  165.     BELL:BELL   ' alert user
  166.  
  167.     ' Give user a description of error
  168.  
  169.     IF ResultCode% = 100 THEN END ‚àÇ
  170.  
  171.     ELSE IF ResultCode% = 106 THEN ‚àÇ
  172.  
  173.         DBoxSay = "Cannot find the label """ & badLabel & ‚àÇ
  174.  
  175.         """ in the file """ & badFile & """.  Program aborted." ‚àÇ
  176.  
  177.     ELSE IF ResultCode% = -108 THEN ‚àÇ
  178.  
  179.         DBoxSay = "Not enough memory to open the file """ & ‚àÇ
  180.  
  181.         badFile & """.  Program aborted." ‚àÇ
  182.  
  183.     ELSE IF ResultCode% = -35 THEN ‚àÇ
  184.  
  185.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  186.  
  187.         """ because volume specified doesn't exist.  Program aborted." ‚àÇ
  188.  
  189.     ELSE IF ResultCode% = -49 THEN ‚àÇ
  190.  
  191.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  192.  
  193.         """ because it is already open for writing.  Program aborted." ‚àÇ
  194.  
  195.     ELSE IF ResultCode% = -47 THEN ‚àÇ
  196.  
  197.         DBoxSay = "Cannot open the file """ & badFile & ‚àÇ
  198.  
  199.         """ because it is busy.  Program aborted." ‚àÇ
  200.  
  201.     ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ‚àÇ
  202.  
  203.         """ in the file """ & badFile & """:  Macintosh error result code = " & ‚àÇ
  204.  
  205.         ResultCode% & ".  Program aborted."
  206.  
  207.     DBOX 1
  208.  
  209.     RETURN
  210.  
  211.  
  212.  
  213. Interrupt:
  214.  
  215.     BELL
  216.  
  217.     DISPLAY "^M^JPlease wait..."
  218.  
  219.     RETURN
  220.  
  221.